package com.zmj.sy.mom.srv.aps.controller;

import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.base.BaseSelectResVo;
import com.zmj.sy.mom.srv.aps.bean.vo.customer.CustomerAddReqVo;
import com.zmj.sy.mom.srv.aps.service.CustomerService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.*;

@RequiredArgsConstructor
@Api(tags = "客户管理")
@RestController
@RequestMapping("/customer")
public class CustomerController {

    private final CustomerService customerService;

    @ApiOperation("客户列表")
    @GetMapping("/select")
    public BaseSelectResVo select(){
        return customerService.select();
    }

    @ApiOperation("2.2.2 生产订单管理-设置客户权重")
    @PostMapping("/add")
    public BaseResVo add(@RequestBody CustomerAddReqVo reqVo){
        customerService.add(reqVo);
        return BaseResVo.ok();
    }

}
